<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Models\Task;

class MarkPostponedTasks extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'app:mark-postponed-tasks';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Execute the console command.
     */
    public function handle()
    {
        Task::where([['end_date', '<', today()], ['status', Task::STATUS_PROGRESSING]])->update(['status' => Task::STATUS_POSTPONED]);
    }
}
